import React, {useState,useRef} from 'react';
// 导入富文本编辑器
import ReactQuill from 'react-quill';
// 导入富文本编辑器的样式
import 'react-quill/dist/quill.snow.css';
import './page4.scss'

function Page4(props) {
    // 定义一个ref对象，用于绑定一个DOM元素
    const contentRef = useRef(null)
    let [content, setCountent] = useState('')
    return (
        <div className='page4'>
            <div className="content" ref={contentRef}>
            </div>
            <div>
                <div>编辑内容：</div>
                <div>
                    <ReactQuill theme="snow" value={content} onChange={setCountent} />
                </div>
                <button onClick={()=>{
                    contentRef.current.innerHTML = content
                }}>提交</button>
            </div>
        </div>
    );
}

export default Page4;
